package org.example.exp3.exam5;

public class Client {
    public static void main(String[] args) {
        EditableTextArea editableTextArea = new EditableTextArea();

        NumberCount numberCount = new NumberCount();
        numberCount.setTextArea(editableTextArea);
        WordCount wordCount = new WordCount();
        wordCount.setTextArea(editableTextArea);
        DetailsDisplay detailsDisplay = new DetailsDisplay();
        detailsDisplay.setTextArea(editableTextArea);
        editableTextArea.attach(numberCount);
        editableTextArea.attach(wordCount);
        editableTextArea.attach(detailsDisplay);

        editableTextArea.edit("hello");
        editableTextArea.edit(" world");
    }
}
